In a system based on Voice over Internet Protocol (VoIP, Voice over Internet Protocol), a packet may need to pass through multiple routers in a transmission process, but because these routers may change in a call process, a transmission delay in the call process may change. In addition, when two or more users attempt to enter a network by using a same gateway, a routing delay may change, and such a delay change is called a delay jitter (delay jitter). Similarly, a delay jitter may also be caused when a receiver, a transmitter, a gateway, and the like use a non-real-time operating system, and in a severe situation, a data packet loss occurs, resulting in speech/audio distortion and deterioration of VoIP quality.
Currently, many technologies have been used at different layers of a communication system to reduce a delay, smooth a delay jitter, and perform packet loss compensation. A receiver may use a high-efficiency jitter buffer processing (JBM, Jitter Buffer Management) algorithm to compensate for a network delay jitter to some extent. However, in a case of a relatively high packet loss rate, apparently, a high-quality communication requirement cannot be met only by using the JBM technology.
To help avoid the quality deterioration problem caused by a delay jitter of a speech/audio frame, a redundancy coding algorithm is introduced. That is, in addition to encoding current speech/audio frame information at a particular bit rate, an encoder encodes other speech/audio frame information than the current speech/audio frame at a lower bit rate, and transmits a relatively low bit rate bitstream of the other speech/audio frame information, as redundancy information, to a decoder together with a bitstream of the current speech/audio frame information. When a speech/audio frame is lost, if a jitter buffer buffers or a received bitstream includes redundancy information of the lost speech/audio frame, the decoder recovers the lost speech/audio frame according to the redundancy information, thereby improving speech/audio quality.
In an existing redundancy coding algorithm, in addition to including speech/audio frame information of the Nth frame, a bitstream of the Nth frame includes speech/audio frame information of the (N-M)th frame at lower bit rate. In a transmission process, if the (N-M)th frame is lost, decoding processing is performed according to the speech/audio frame information that is of the (N-M)th frame and is included in the bitstream of the Nth frame, to recover a speech/audio signal of the (N-M)th frame.
It can be learned from the foregoing description that, in the existing redundancy coding algorithm, redundancy bitstream information is obtained by means of encoding at a lower bit rate, which is therefore highly likely to cause signal instability and further cause low quality of an output speech/audio signal.